<?php
/**
 * 制作:  叶风
 * Qq:    355007778
 * Email: ye.fn@163.com
 *
 */
class out
{
	function __construct()
	{
		$this->_a = array($_GET, YF_f::$arr);
	}
	
	// echo
	function go()
    {
		$c = YF_f::initC( '\c\\' . realFunName(str_replace('/', '\\', YF_f::$arr['c'])) );
        ob_start();
		YF_f::callFunction($c, 'index_' . realFunName(YF_f::$arr['f']));
		$c->display();
		list($_GET, YF_f::$arr) = $this->_a;
    }
	
    /**
     * 参数分解
     * @param type $url
     */
	function parseParams($url='')
	{
		if ($url)
		 {
			parse_str($url, $get);
			$_GET = array_merge($_GET, $get);
		 }
		if (is_string($_GET['u']) )
		 {
		 	$u = $_GET['u'];
			$a = explode('-', $u);
			foreach ($a as $v)
			 {
				$_  = substr($v,0,1);
				$v  = substr($v,1);
				YF_f::$arr[$_] = $v;
			 }
		 }
		if (YF_f::$arr['c']=='')
			YF_f::$arr['c'] = 'home';
		else
			YF_f::$arr['c'] = str_replace( '/', '\\',YF_f::$arr['c']);
		
		YF_f::$arr['f']=='' && YF_f::$arr['f'] = 'home';
		return $this;
	}
}
?>